<?php

require_once dirname(__FILE__).'/cf/config.php';
require_once cf\Config::path.'param.php';
require_once cf\Config::path.'image.php';
require_once cf\Config::path.'api/page.php';

define('SMARTY_DIR','./smarty/');
require_once SMARTY_DIR . 'Smarty.class.php';

$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = false;
$smarty->addPluginsDir(cf\Config::path.'components/');

date_default_timezone_set('UTC');
setlocale(LC_ALL,"en_US.utf8");

function show($template, $name, $crumbs=array(), $title='', $keywords='', $descr='')
{
	global $smarty, $lang;

	$smarty->assign('name',$name);
	$smarty->assign('crumbs',$crumbs);
	$smarty->assign('title',$title);
	$smarty->assign('keywords',$keywords);
	$smarty->assign('descr',$descr);
	
	$smarty->assign('tpl', "$template.tpl");

	$smarty->display('main.tpl');
}
$smarty->assign('mainMenu',  cf\api\page\getTree());
$smarty->assign('bottomMenu',cf\api\page\getTree('bottom_menu'));

$smarty->assign('randomHeadImage',rand(1,5))

?>